#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <math.h>
#include <string.h>

//Ref: https://blog.csdn.net/baidu_23955875/article/details/46532339
int main() {
	int num;
	char in[128];
	scanf("%s", in);
	num = 0;
	int inlen, s_pos;
	s_pos = 0;
	inlen = strlen(in);

	int dec[128];
	int out_buf[128 * 4];

	char *in_i = in;
	int *dec_i = dec;

	while (*in_i != 0) {
		*dec_i++ = *in_i++ - '0';
	}

	int flag = 0, flag1 = 0;
	while (inlen - s_pos != 1) {
		flag = dec[s_pos] % 2;
		dec[s_pos] /= 2;
		for (int i = s_pos + 1; i < inlen - 1; i++) {
			flag1 = flag * 10 + dec[i];
			flag = flag1 % 2;
			dec[i] = flag1 / 2;
		}

		flag1 = flag * 10 + dec[inlen - 1];
		dec[inlen - 1] = flag1 / 2;
		out_buf[num++] = flag1 % 2;
		if (dec[s_pos] == 0) {
			s_pos++;
		}
	}

	int n = dec[s_pos];
	while (n > 0) {
		out_buf[num++] = n % 2;
		n /= 2;
	}

	for (int i = num - 1; i >= 0; i--) {
		putchar('0' + out_buf[i]);
	}
}
